import { defineNuxtPlugin, defineNuxtLink } from '#app';
import { markRaw } from 'vue';
import {
    Inkline,
    useOptions,
    colorModeAddon,
    modalAddon,
    toastAddon,
    colorModeLocalStorageKey
} from 'inkline';

export default defineNuxtPlugin((nuxtApp) => {
    const NuxtLink = defineNuxtLink({ componentName: 'InklineNuxtLink' });

    nuxtApp.vueApp.use(Inkline, {
        addons: [
            colorModeAddon(),
            modalAddon(),
            toastAddon()
        ],
        colorMode: {
            renderMode: 'universal',
        },
        router: {
            component: markRaw(NuxtLink)
        },
        ...<%= JSON.stringify(options, 4) %>
    });
});
